/**
 * common
 */
define(function(require) {
   var $ = require('$');
	var base=require('base');
	var responsive=require('modules/responsive');

	//gotop
	$('body').on('click','.gotop',function(){$('html,body').stop().animate({scrollTop:'0'},300)});
	//closewin
	$('body').on('click','.closewin',function(){window.opener=null;window.open("","_self");window.close()});
	//print
	$('body').on('click','.print',function(){window.print()});
	//favorite
	$('body').on('click','.favorite',function(){var sURL = "http:&#47;&#47;"+document.domain+"&#47;",sTitle = document.title;try{window.external.addFavorite(sURL, sTitle)} catch (e){try{window.sidebar.addPanel(sTitle, sURL, "")}catch (e){alert("加入收藏失败，请使用Ctrl+D进行添加")}}});
	//sethome
	$('body').on('click','.sethome',function(){var vrl="http:&#47;&#47;"+document.domain+"&#47;";if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。")}var prefs=Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);prefs.setCharPref('browser.startup.homepage',vrl)}else{alert("您的浏览器不支持自动设为首页，请您手动进行设置！")}});
	//fontsizer
	var $speech=$('.myart'),defaultsize=parseFloat($speech.css('font-size'));
	$('#switcher a').click(function(){
		var num=parseFloat($speech.css('font-size'));
		switch(this.id){
			case'small':num/=1.4;
			break;
			case'big':num*=1.4;
			break;
			default:num=defaultsize;
		}
		$speech.css('font-size',num+'px');
	});
	// placeholder
	var $placeholder=$('.placeholder');
	if($placeholder.length && !('placeholder' in document.createElement('input'))){
		$placeholder.each(function(index, element) {
			var placeval=$(this).attr('placeholder');
			$(this).val(placeval).on({
				'blur':function(){
				if($.trim($(this).val())===''){$(this).val(placeval).removeClass('on')}
				},
				'focus':function(){
					if($(this).val()===placeval){$(this).val('').addClass('on')}
					}});
		});
	};
	//fadeIn
	$(function(){
		$('.opc0').animate({'opacity':'1'},'fast')
		});
	//导航当前状态
	//var jrChannelArr=jrChannel.split('#');
	//$('.nav').children('li').eq(jrChannelArr[0]).addClass('cur').find('li').eq(jrChannelArr[1]).addClass('cur');
		
})

